google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLoadCallback(function(){ var data = new google.visualization.DataTable(); data.addColumn('string', '日'); data.addColumn('number', '推測'); data.addColumn('number', '推測'); data.addColumn('number', 'iOS前月'); data.addColumn('number', 'iOS当月'); data.addRows([ ['1日',870,382,null,null], ['2日',null,348,null,null], ['3日',942,175,null,175], ['4日',762,241,null,null], ['5日',903,275,null,null], ['6日',94,409,94,null], ['7日',121,453,121,null], ['8日',208,519,null,null], ['9日',248,393,null,null], ['10日',296,346,null,null], ['11日',279,327,null,null], ['12日',304,338,null,null], ['13日',310,467,null,null], ['14日',310,574,null,null], ['15日',250,620,null,null], ['16日',266,420,null,null], ['17日',306,272,null,null], ['18日',322,427,null,null], ['19日',322,449,null,null], ['20日',133,572,133,null], ['21日',198,673,198,null], ['22日',256,666,null,null], ['23日',281,650,null,null], ['24日',326,657,null,null], ['25日',322,583,null,null], ['26日',298,474,null,null], ['27日',332,581,null,null], ['28日',308,598,null,null], ['29日',332,701,null,null], ['30日',381,272,null,null], ['31日',395,null,null,null] ]); var options = { chartArea: {'width':'85%', 'height':'65%', 'left':60 }, 'pointSize': 3, hAxis: { titleTextStyle:{italic:false}, format:'#',ticks: [1,5,10,15,20,25,30] }, vAxis: { title:'2024年4月ランキング', titleTextStyle:{italic:false}, format:'#',viewWindow:{min:0,max:1000},direction:-1 }, legend: {position: 'top' }, tooltip: { trigger: 'both' }, focusTarget: 'category', colors:['skyblue','pink','#2980b9','#e74c3c'] }; var chart = new google.visualization.LineChart(document.getElementById('graphField')); chart.draw(data, options); var lastlogday=30 -1 ; var lastlogcat=2; if(lastlogday>=0){ chart.setSelection([{ row: lastlogday, column: lastlogcat }]); google.visualization.events.addListener(chart, 'click', function() { if(chart.getSelection()[0]){ //chart.setSelection(null) } }); } });